package com.frame.management;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class MainView {
	private JFrame f = new JFrame("添加学生信息");
	private JTextField text = new JTextField(5);
	private JTextField text1 = new JTextField(5);
	private JTextField text2 = new JTextField(5);

	// 框架
	public void daoru() {

		f.setLayout(new FlowLayout(FlowLayout.LEFT, 20, 30));

		JLabel lname = new JLabel("姓名：");
		f.add(lname);
		f.add(text);
		JLabel lid = new JLabel("学号：");
		f.add(lid);
		f.add(text1);

		JLabel lgender = new JLabel("班级：");
		f.add(lgender);
		f.add(text2);

		JButton bt = new JButton("添加");
		f.add(bt);
		bt.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				insertStudent();
			}

		});

		f.setSize(550, 150);
		f.setLocation(200, 200);
		f.setVisible(true);

	}

	// 具体实现添加函数
	public void insertStudent() {

	}

	public static void main(String arges[]) {
		MainView it = new MainView();
		it.daoru();
	}
}
